<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Workflow.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="Admin_Workflow_Workflow" Title="APM - Manage Workflow" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="workflow">
    <ul id="path">
        <li><a href="../../Home.aspx">Home</a> &gt;</li>
        <li>Administration &gt;</li>
        <li>Workflow</li>
    </ul>
    <h3 class="workflow"><span>Manage Workflow</span></h3>
    <div id="content">
        <p>
        </p>
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblMsg" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <asp:TextBox ID="txtWkfwID" Text='<%# Eval("WorkflowID") %>' runat="server" ReadOnly="true"
                    Visible="false"></asp:TextBox>
                <asp:Label runat="server" ID="lblWorkflow">Workflow Name</asp:Label>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtWkfwName" Text='<%# Eval("WorkFlowName") %>' runat="server" ReadOnly="false"
                        Visible="true" MaxLength="100" CssClass="input"></asp:TextBox></td>
                <asp:RequiredFieldValidator ID="rfvWorkFlowName" runat="server" ControlToValidate="txtWkfwName"
                    ErrorMessage="Required Field: Workflow Name" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="revAppName" runat="server" ControlToValidate="txtWkfwName"
					Display="None" ErrorMessage="Invalid Input: Workflow Name" SetFocusOnError="true"
					ValidationExpression="<%$ AppSettings:WorkFlowNameRegEx %>"></asp:RegularExpressionValidator>
            </tr>
            <tr>
                <td>
                    <asp:Label runat="server" ID="lblWorkFlowDesc">Description</asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtWorkFlowDesc" Text='<%# Eval("Description") %>' runat="server"
                        ReadOnly="false" Width="507" Height="50" Visible="true" MaxLength="1000" TextMode="MultiLine"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="regexDesc" runat="server" ControlToValidate="txtWorkFlowDesc"
                        ErrorMessage="Invalid Input: Workflow Description" SetFocusOnError="True" ValidationExpression="<%$ AppSettings:WorkFlowDescRegEx %>"
                        Display="None"></asp:RegularExpressionValidator>
                </td>
            </tr>
        </table>
        <asp:Repeater ID="rptLifeCycles" runat="server">
            <HeaderTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:Label runat="server" ID="lblLCName">LifeCycle Name</asp:Label></td>
                        <td>
                            <asp:Label runat="server" ID="lblLCDesc">Description</asp:Label></td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr valign="top">
                    <td>
                        <asp:TextBox ID="txtLCID" runat="server" Text='<%# Eval("LifeCycleID") %>' Visible="false"
                            ReadOnly="true"></asp:TextBox>
                        <asp:TextBox MaxLength="100" ID="txtLifeCycleName" runat="server" Text='<%# Eval("LifeCycleName") %>'></asp:TextBox>
                        <asp:RegularExpressionValidator ID="regexLifeCycleName" runat="server" ControlToValidate="txtLifeCycleName"
                            ErrorMessage="Invalid Input: Lifecycle Name" SetFocusOnError="True" ValidationExpression="<%$ AppSettings:LifeCycleNameRegEx %>"
                            Display="None"></asp:RegularExpressionValidator>
                    </td>
                    <td>
                        <asp:TextBox ID="txtLifecycleDesc" runat="server" Height="50" MaxLength="1000" onkeypress="verifyMax(this, 1000)"
                            onpaste="verifyPaste(this, 1000, 'Description')" Text='<%# Eval("Description") %>'
                            TextMode="MultiLine" Width="350"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="regexLCDesc" runat="server" ControlToValidate="txtLifecycleDesc"
                            ErrorMessage="Invalid Input: Lifecycle Description" SetFocusOnError="True" ValidationExpression="<%$ AppSettings:LifeCycleDescRegEx %>"
                            Display="None"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Repeater runat="server" ID="rptTaskItems">
                            <HeaderTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            <asp:Label runat="server" ID="lblTaskName">Task Name</asp:Label></td>
                                        <td>
                                            <asp:Label runat="server" ID="lblTaskDesc">Description</asp:Label></td>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr valign="top">
                                    <td>
                                        &nbsp;</td>
                                    <td>
                                        <asp:TextBox ID="txtTSID" runat="server" Text='<%# Eval("TaskID") %>' Visible="false"
                                            ReadOnly="true"></asp:TextBox>
                                        <asp:TextBox ID="txtTSName" Width="350" runat="server" Text='<%# Eval("TaskName") %>'
                                            MaxLength="200" CssClass="input"></asp:TextBox >
                                        <asp:RegularExpressionValidator ID="regexTasks" runat="server" ControlToValidate="txtTSName"
                                            ErrorMessage="Invalid Input: Task Name" SetFocusOnError="True" ValidationExpression="<%$ AppSettings:TaskNameRegEx %>"
                                            Display="None"></asp:RegularExpressionValidator>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTSDesc" runat="server" MaxLength="500" onkeypress="verifyMax(this, 500)"
                                            onpaste="verifyPaste(this, 500, 'Description')" Text='<%# Eval("Description") %>'
                                            TextMode="MultiLine"></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="regexTaskDesc" runat="server" ControlToValidate="txtTSDesc"
                                            ErrorMessage="Invalid Input: Task Description" SetFocusOnError="True" ValidationExpression="<%$ AppSettings:TaskDescRegEx %>"
                                            Display="None"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <asp:Button ID="btnSave" OnClick="WorkFlow_Save" runat="server" Text="Add New LifeCycle"
            Enabled="true" />
        <asp:Button ID="btnSubmit" OnClick="WorkFlow_Submit" runat="server" Text="Submit"
            Enabled="true" />
        <asp:ValidationSummary ID="vsWorkFlow" runat="server" HeaderText="Please correct the following:"
            ShowMessageBox="true" ShowSummary="false" DisplayMode="BulletList" />
    </div>
    </div>
</asp:Content>
